package com.smarttourism.service.impl;

import com.smarttourism.domain.Room;
import com.smarttourism.mapper.RoomMapper;
import com.smarttourism.service.RoomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;

    @Override
    public int add(Room room) {
        return roomMapper.insert(room);
    }

    @Override
    public int removeBatch(Integer[] ids) {
        return roomMapper.delete(ids);
    }

    @Override
    public int updateById(Room room) {
        return roomMapper.update(room);
    }

    @Override
    public Room findById(Integer id) {
        return roomMapper.selectById(id);
    }

    public List<Room> findAll(Integer rNum, String typeName){
        return roomMapper.selectAll(rNum,typeName);
    }
}
